package client.global.commlib.toast

import android.text.TextUtils
import android.widget.Toast
import client.global.commlib.BaseApplication

/**
 * Date: 2022/3/18 16:58
 * Description:
 */
class MyToast private constructor() {
    val mToast: Toast

    init {
        mToast = Toast.makeText(
            BaseApplication.Companion.getInstance().getApplicationContext(),
            " ",
            Toast.LENGTH_SHORT
        );
    }

    fun show(message: String?) {
        if (TextUtils.isEmpty(message)) {
            return
        }
        mToast.setText(message);
    }

    fun show(message: Int) {
        mToast.setText(message);
        mToast.show();
    }

    companion object {
        val instance = MyToast()
    }
}